package com.zpphis.mapper;

import com.zpphis.entity.Department;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author zpp
 * @since 2022-11-22
 */
@Mapper
public interface DepartmentMapper extends BaseMapper<Department> {

    @Select("SELECT\n" +
            "\td.id,\n" +
            "\td.dept_code,\n" +
            "\td.dept_name,\n" +
            "\tc.constant_name deptCategory,\n" +
            "\tdt.dept_type_name deptType\n" +
            "FROM\n" +
            "\tt_department d\n" +
            "INNER JOIN t_department_type dt ON dt.id = d.dept_type_id\n" +
            "INNER JOIN t_constant_item c ON c.id = d.dept_category_id\n" +
            "WHERE\n" +
            "\td.del_mark = 1")
    List<Map<String, Object>> listExtend();
}
